package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DzPingceMapper;
import com.ruoyi.system.domain.DzPingce;
import com.ruoyi.system.service.IDzPingceService;


import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.mapper.DzHuiyuanMapper;
import com.ruoyi.system.domain.DzHuiyuan;
import com.ruoyi.system.service.IDzHuiyuanService;

/**
 * 楼盘评测Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-16
 */
@Service
public class DzPingceServiceImpl implements IDzPingceService 
{
    @Autowired
    private DzPingceMapper dzPingceMapper;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private IDzHuiyuanService dzHuiyuanService;

    /**
     * 查询楼盘评测
     * 
     * @param cpId 楼盘评测主键
     * @return 楼盘评测
     */
    @Override
    public DzPingce selectDzPingceByCpId(Long cpId)
    {
        return dzPingceMapper.selectDzPingceByCpId(cpId);
    }

    /**
     * 查询楼盘评测列表
     * 
     * @param dzPingce 楼盘评测
     * @return 楼盘评测
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<DzPingce> selectDzPingceList(DzPingce dzPingce)
    {

        //权限控制
        return dzPingceMapper.selectDzPingceList(dzPingce);
    }

    @Override
    public List<DzPingce> selectDzPingceListWeb(DzPingce dzPingce)
    {
        return dzPingceMapper.selectDzPingceList(dzPingce);
    }

    /**
     * 新增楼盘评测
     * 
     * @param dzPingce 楼盘评测
     * @return 结果
     */
    @Override
    public int insertDzPingce(DzPingce dzPingce)
    {
        dzPingce.setCreateTime(DateUtils.getNowDate());
        return dzPingceMapper.insertDzPingce(dzPingce);
    }

    /**
     * 修改楼盘评测
     * 
     * @param dzPingce 楼盘评测
     * @return 结果
     */
    @Override
    public int updateDzPingce(DzPingce dzPingce)
    {
        return dzPingceMapper.updateDzPingce(dzPingce);
    }

    /**
     * 批量删除楼盘评测
     * 
     * @param cpIds 需要删除的楼盘评测主键
     * @return 结果
     */
    @Override
    public int deleteDzPingceByCpIds(Long[] cpIds)
    {
        return dzPingceMapper.deleteDzPingceByCpIds(cpIds);
    }

    /**
     * 删除楼盘评测信息
     * 
     * @param cpId 楼盘评测主键
     * @return 结果
     */
    @Override
    public int deleteDzPingceByCpId(Long cpId)
    {
        return dzPingceMapper.deleteDzPingceByCpId(cpId);
    }
}
